
import org.junit.Test;
import java.io.FileWriter;
import java.io.IOException;
public class Read_ {
    public static void main(String[] args) {
    }
   /* @Test
    public void read(){
        FileReader fileReader=null;
        try {
            fileReader=new FileReader("d:\\next2.txt");
            char[] chars=new char[8];
            int f=0;
            while ((f=fileReader.read(chars))!=-1){
                System.out.println(new String(chars,0,f));
            }
            //System.out.println((char)fileReader.read());
        } catch (IOException e) {
            e.printStackTrace();
        }try {
            fileWriter.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }*/
    @Test
    public void read01(){
        FileWriter fileWriter=null;
        try {
            fileWriter=new FileWriter("d:\\next3.txt");
            //char[] chars={'h','s','p'};
            String str="牛逼";
            fileWriter.write(str,0,1);
        } catch (IOException e) {
            e.printStackTrace();
        }try {
            fileWriter.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
